package cn.com.nes.site.module.service;

import cn.com.nes.common.util.DBUitl;
import cn.com.nes.common.util.DBUtils;
import cn.com.nes.site.entity.DataReq;
import cn.com.nes.site.entity.PageData;
import cn.com.nes.site.module.dao.ActiveDaoImpl;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

@Scope("prototype")
@Service
public class ActiveService {

	@Resource
	private ActiveDaoImpl impl;

	public PageData saveActiveSession(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.saveActiveSession(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveSession(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveSession(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData delActiveSession(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.delActiveSession(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveUser(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData delActiveUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.delActiveUser(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveRecord(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveRecord(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData delActiveRecord(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.delActiveRecord(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveSessionApp(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveSessionApp(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveDetails(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveDetails(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getUserInfo(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getUserInfo(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getUserCjcs(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getUserCjcs(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPrizeReceive(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPrizeReceive(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveRecordApp(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		Connection conn_shop = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			conn_shop = DBUitl.getDBConn_newmall();
			res = impl.getActiveRecordApp(conn,conn_shop,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
			conn_shop.rollback();
		} finally {
			if (conn != null)
				conn.close();
			if (conn_shop != null)
			conn_shop.close();
		}
		return res;
	}

	public PageData saveActiveUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.saveActiveUser(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData saveAddress(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.saveAddress(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCActiveList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCActiveList(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCActiveDetail(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCActiveDetail(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData savePCActive(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCActive(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData savePCLuckyUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCLuckyUser(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData addLy(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.addLy(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData addTp(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.addTp(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPrizeTp(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPrizeTp(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData delPCActive(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.delPCActive(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCActiveShow(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCActiveShow(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getLuckUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getLuckUser(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getWinList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getWinList(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getJoinUserList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getJoinUserList(conn,req);
			if(res.getRetCode()==0) {
				conn.commit();
			}
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData savePCAwardRecord(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCAwardRecord(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActivityList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActivityList(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveJoinAndArea(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveJoinAndArea(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getCouponUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getCouponUser(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getHelpUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getHelpUser(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getUserInfoByOpenId(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getUserInfoByOpenId(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActivityUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActivityUser(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public List getParamData(String param_type, String value) throws SQLException {
		List<Map<String, Object>> res = new ArrayList<>();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getParamData(conn,param_type,value);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActivitySelect(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActivitySelect(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData saveForwardRecord(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.saveForwardRecord(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveSelect(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveSelect(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getWXActiveList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getWXActiveList(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getForwardRecordForUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getForwardRecordForUser(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getForwardUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getForwardUser(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData okCashPrize(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.okCashPrize(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveUserAddressList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveUserAddressList(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveUserAddressDetail(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveUserAddressDetail(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData saveActiveUserAddress(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.saveActiveUserAddress(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData delActiveUserAddress(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.delActiveUserAddress(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveUserDefaultAddress(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveUserDefaultAddress(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData savePCActiveJoinUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCActiveJoinUser(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}
	
	public PageData savePCActiveJoinUser2023(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCActiveJoinUser2023(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getCustomActiveList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getCustomActiveList(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getZiliaoParam(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getZiliaoParam(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData saveCustomer(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.saveCustomer(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getShopList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		Connection conn_shop = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			conn_shop = DBUitl.getDBConn_newmall();
			res = impl.getShopList(conn,conn_shop,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
			conn_shop.rollback();
		} finally {
			if (conn != null)
				conn.close();
				conn_shop.close();
		}
		return res;
	}

	public PageData getProductIdByCouponId(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		Connection conn_shop = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			conn_shop = DBUitl.getDBConn_newmall();
			res = impl.getProductIdByCouponId(conn,conn_shop,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
			conn_shop.rollback();
		} finally {
			if (conn != null)
				conn.close();
			conn_shop.close();
		}
		return res;
	}

	public PageData getJpAndSaveRecord(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		Connection conn_shop = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			conn_shop = DBUitl.getDBConn_newmall();
			res = impl.getJpAndSaveRecord(conn,conn_shop,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
			conn_shop.rollback();
		} finally {
			if (conn != null)
				conn.close();
			if (conn_shop != null)
				conn_shop.close();
		}
		return res;
	}

	public PageData saveUserModel(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.saveUserModel(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getUserModel(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getUserModel(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData copyActiveSession(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.copyActiveSession(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getWchatMenu(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getWchatMenu(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATActiveList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATActiveList(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData delPCWCHATActive(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.delPCWCHATActive(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getYaoyiyaoWinList(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getYaoyiyaoWinList(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATActiveDetail(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATActiveDetail(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData savePCWCHATActive(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCWCHATActive(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATActiveShow(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATActiveShow(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATActiveShow_xcx(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATActiveShow_xcx(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATPersonShow(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATPersonShow(conn,req);
			if(res.getRetCode()==0) {
				conn.commit();
			}
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATTimeShake(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATTimeShake(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData savePCWCHATChartShake(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCWCHATChartShake(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATChartShake(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATChartShake(conn,req);
			if(res.getRetCode()==0) {
				conn.commit();
			}
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATChartShake_xcx(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATChartShake_xcx(conn,req);
			if(res.getRetCode()==0) {
				conn.commit();
			}
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData savePCWCHATActiveUser(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCWCHATActiveUser(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData savePCWCHATAShake(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.savePCWCHATAShake(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATUserhj(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATUserhj(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getPCWCHATUserimg(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getPCWCHATUserimg(conn,req);
			if(res.getRetCode()==0) {
				conn.commit();
			}
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData saveActiveIsStart(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.saveActiveIsStart(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData getActiveIsStart(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.getActiveIsStart(conn,req);
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

	public PageData modifyState(DataReq req) throws SQLException {
		PageData res = new PageData();
		Connection conn = null;
		try {
			conn = DBUtils.getJNDIDBConn();
			res = impl.modifyState(conn,req);
			conn.commit();
		} catch (Exception e) {
			e.printStackTrace();
			conn.rollback();
		} finally {
			if (conn != null)
				conn.close();
		}
		return res;
	}

}